// avrlib_string.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>

#include "avrlib-string.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	char c = 'a';
	char * str = "  123abc789abcxyzABCXYZ      ";
	//char * str = "";
	char * substr = "abc";
	int begin = 1;
	int end = 10;

	cout << "string: [" << str << "]" <<endl;
	cout << "substring: [" << substr << "]" <<endl;
	cout << "char: " << c <<endl;
	cout << "begin: " << begin <<endl;
	cout << "end: " << end <<endl;

	cout << "length(char *): " << length(str) <<endl;
	cout << "sizeof(char *): " << sizeof(str) <<endl;
	cout << "indexOf(char*, char, int): " << indexOf(str, c) <<endl;
	cout << "lastIndexOf(char*, char, int): " << lastIndexOf(str, c) <<endl;
	cout << "indexOf(char*, char*, int): " << indexOf(str, substr) <<endl;
	cout << "lastIndexOf(char*, char*, int): " << lastIndexOf(str, substr) <<endl;
	cout << "subString(char*, int): " << subString(str, begin) <<endl;
	cout << "subString(char*, int, int): " << subString(str, begin, end) <<endl;
	cout << "replace(const char *, const char *, const char *, int, bool): " << replace(str, substr, "(...)") <<endl;
	cout << "trimLead(char*): [" << trimLead(str) << "]" <<endl;
	cout << "trimTrail(char*): [" << trimTrail(str) << "]" <<endl;
	cout << "trim(char*): [" << trim(str) << "]" <<endl;
	cout << "clone(char*): " << clone(str) <<endl;
	cout << "equals(const char *, const char *): " << equals("abc", "123") <<endl;
	cout << "equals(const char *, const char *): " << equals("abc", "abc") <<endl;	
	cout << "equals(const char *, const char *): " << equals("aBc", "abC") <<endl;	
	cout << "equalsIgnoreCase(const char *, const char *): " << equalsIgnoreCase("abc", "123") <<endl;
	cout << "equalsIgnoreCase(const char *, const char *): " << equalsIgnoreCase("abc", "abc") <<endl;
	cout << "equalsIgnoreCase(const char *, const char *): " << equalsIgnoreCase("aBc", "abC") <<endl;
	cout << "valueOf(bool): " << valueOf(false) <<endl;
	cout << "valueOf(bool): " << valueOf(true) <<endl;
	cout << "valueOf(char): " << valueOf(4) <<endl;
	cout << "valueOf(char): " << valueOf(128) <<endl;
	cout << "valueOf(char): " << valueOf(-127) <<endl;
	cout << "valueOf(short): " << valueOf(4) <<endl;
	cout << "valueOf(short): " << valueOf(128) <<endl;
	cout << "valueOf(short): " << valueOf(-127) <<endl;
	cout << "valueOf(int): " << valueOf(4) <<endl;
	cout << "valueOf(int): " << valueOf(128) <<endl;
	cout << "valueOf(int): " << valueOf(-127) <<endl;
	cout << "valueOf(float, char): " << valueOf((float)3.3, 1) <<endl;
	cout << "valueOf(float, char): " << valueOf((float)-3.0573, 1) <<endl;
	cout << "valueOfAsWord(bool): " << valueOfAsWord(false) <<endl;
	cout << "valueOfAsWord(bool): " << valueOfAsWord(true) <<endl;
	cout << "toLowerCase(const char *): " << toLowerCase(str) <<endl;
	cout << "toUpperCase(const char *): " << toUpperCase(str) <<endl;
	cout << "reverse(const char *): " << reverse(str) <<endl;
	cout << "append(const char *, const char *): " << append("abc", "123") <<endl;
	cout << 4%10<<endl;
	double pi = 3.14;
	cout << pi<<endl;

	int m;
	cin >> m;

	return 0;
}

